package com.xiaoshuidi.cloud.module.contract.api.contract;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.contract.convert.contract.CustomerCompanyConvert;
import com.xiaoshuidi.cloud.module.contract.service.bill.OrderFeesService;
import com.xiaoshuidi.cloud.module.contract.vo.OrderFeesDetailApiVo;
import com.xiaoshuidi.cloud.module.contract.api.OrderFeesApi;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.xiaoshuidi.cloud.framework.common.pojo.CommonResult.success;

@Slf4j
@RestController
@Validated
@RequiredArgsConstructor
public class OrderFeesApiImpl implements OrderFeesApi {

    @Resource
    private OrderFeesService orderFeesService;

    @Override
    public CommonResult<OrderFeesDetailApiVo> orderDetail(Long id) {
        return success(CustomerCompanyConvert.INSTANCE.convert(orderFeesService.getOrderFeeDetail(id)));
    }
}
